home *** CD-ROM | disk | FTP | other *** search
- Path: dal1498.computek.net!user
- From: coc@computek.net (Chad Cranfill)
- Newsgroups: comp.lang.c
- Subject: Re: What the hell is THIS?!
- Date: Sat, 13 Jan 1996 02:53:42 -0600
- Organization: Compu-Net DFW's Premiere Internet Access Provider
- Message-ID: <coc-1301960253420001@dal1498.computek.net>
- References: <4d6rgh$rfu@abel.cc.sunysb.edu>
- NNTP-Posting-Host: dal1498.computek.net
- X-Newsreader: Yet Another NewsWatcher 2.1.5
-
- In article <4d6rgh$rfu@abel.cc.sunysb.edu>, bmadhusu@engws12.ic.sunysb.edu
- (Bommasamudram Madhusudan) wrote:
-
- > Can someone explain what
- >
- > int (*p)[3] is?????
- >
-
- Starting with the "p", we parse the expression thusly: "p is an array of 3
- pointers to int". If you need help with this (believe me, I did!) get the
- book "Deep C Secrets". It presents an algorithmic method for decoding
- statements like this, and gives hints on how to implement a C program that
- will do this for you.
-
- >
- > I can say things like:
- >
- > (*p)[0] = 3; for e.g, but when I print the value using:
- >
- > printf("%d",(*p)[0]) I get a core dump!
-
- Instead of using the dereference operator here, you may want to just say:
-
- printf("%d", p[0]);
-
- This just seems to be the intuitive way to do this, but since I haven't
- tried this example I could be wrong.
-
- --Chad
-